56 research outputs found
Arithmetic and Boolean Operations on Recursively Run-Length Compressed Natural Numbers
We study arithmetic properties of a new tree-based canonical num- ber representation, recursively run-length compressed natural numbers, defined by applying recursively a run-length encoding of their binary digits. We design arithmetic and boolean operations with recursively run- length compressed natural numbers that work a block of digits at a time and are limited only by the representation complexity of their operands, rather than their bitsizes. As a result, operations on very large numbers exhibiting a regular structure become tractable. In addition, we ensure that the average complexity of our operations is still within constant factors of the usual arithmetic operations on binary numbers. Arithmetic operations on our recursively run-length compressed are specified as pattern-directed recursive equations made executable by using a purely declarative subset of the functional language Haskell
Lazy Stream Programming in Prolog
In recent years, stream processing has become a prominent approach for
incrementally handling large amounts of data, with special support and
libraries in many programming languages. Unfortunately, support in Prolog has
so far been lacking and most existing approaches are ad-hoc. To remedy this
situation, we present lazy stream generators as a unified Prolog interface for
stateful computations on both finite and infinite sequences of data that are
produced incrementally through I/O and/or algorithmically.
We expose stream generators to the application programmer in two ways: 1)
through an abstract sequence manipulation API, convenient for defining custom
generators, and 2) as idiomatic lazy lists, compatible with many existing list
predicates. We define an algebra of stream generator operations that extends
Prolog via an embedded language interpreter, provides a compact notation for
composing generators and supports moving between the two isomorphic
representations.
As a special instance, we introduce answer stream generators that encapsulate
the work of coroutining first-class logic engines and support interoperation
between forward recursive AND-streams and backtracking-generated OR-streams.
Keywords: lazy stream generators, lazy lists, first-class logic engines,
stream combinators, AND-stream / OR-stream interoperation, Prolog extensionsComment: In Proceedings ICLP 2019, arXiv:1909.0764
Improving Prolog Programs: Refactoring for Prolog
Refactoring is an established technique from the OO-community to restructure
code: it aims at improving software readability, maintainability and
extensibility. Although refactoring is not tied to the OO-paradigm in
particular, its ideas have not been applied to Logic Programming until now.
This paper applies the ideas of refactoring to Prolog programs. A catalogue
is presented listing refactorings classified according to scope. Some of the
refactorings have been adapted from the OO-paradigm, while others have been
specifically designed for Prolog. Also the discrepancy between intended and
operational semantics in Prolog is addressed by some of the refactorings.
In addition, ViPReSS, a semi-automatic refactoring browser, is discussed and
the experience with applying \vipress to a large Prolog legacy system is
reported. Our main conclusion is that refactoring is not only a viable
technique in Prolog but also a rather desirable one.Comment: To appear in ICLP 200
A Formal, Resource Consumption-Preserving Translation of Actors to Haskell
We present a formal translation of an actor-based language with cooperative
scheduling to the functional language Haskell. The translation is proven
correct with respect to a formal semantics of the source language and a
high-level operational semantics of the target, i.e. a subset of Haskell. The
main correctness theorem is expressed in terms of a simulation relation between
the operational semantics of actor programs and their translation. This allows
us to then prove that the resource consumption is preserved over this
translation, as we establish an equivalence of the cost of the original and
Haskell-translated execution traces.Comment: Pre-proceedings paper presented at the 26th International Symposium
on Logic-Based Program Synthesis and Transformation (LOPSTR 2016), Edinburgh,
Scotland UK, 6-8 September 2016 (arXiv:1608.02534
Improving the compilation of prolog to C using moded types and determinism information
We describe the current status of and provide performance
results for a prototype compiler of Prolog to C, ciaocc. ciaocc is novel in that it is designed to accept different kinds of high-level information, typically obtained via an automatic analysis of the initial Prolog program and expressed in a standardized language of assertions. This information is used to optimize the resulting C code, which is then processed by an off-the-shelf C compiler. The basic translation process essentially mimics the unfolding of a bytecode emulator with respect to the particular bytecode corresponding to the Prolog program. This is facilitated by a flexible design of the instructions and their lower-level components. This approach allows reusing a sizable amount of the machinery of the bytecode emulator: predicates already written in C, data definitions, memory management routines and áreas, etc., as well as mixing emulated bytecode with native code in a relatively straightforward way. We report on the performance of programs compiled by the current versión of the system, both with and without analysis information
Hall Effect of Spin Waves in Frustrated Magnets
We examine a possible spin Hall effect for localized spin systems with no
charge degrees of freedom. In this scenario, a longitudinal magnetic field
gradient induces a transverse spin current carried by spin wave excitations
with an anomalous velocity which is associated with the Berry curvature raised
by spin chirality, in analogy with anomalous Hall effects in itinerant electron
systems. Our argument is based on a semiclassical equations of motion
applicable to general spin systems. Also, a microscopic model of frustrated
magnets which exhibits the anamalous spin Hall effect is presented.Comment: 5 pages, title and presentation style are changed, accepted for
publication in Phys. Rev. Let
Selection-free predictions in global games with endogenous information and multiple equilibria
Global games with endogenous information often exhibit multiple equilibria. In this paper, we show how one can nevertheless identify useful predictions that are robust across all equilibria and that cannot be delivered in the common-knowledge counterparts of these games. Our analysis is conducted within a flexible family of games of regime change, which have been used to model, inter alia, speculative currency attacks, debt crises, and political change. The endogeneity of information originates in the signaling role of policy choices. A novel procedure of iterated elimination of nonequilibrium strategies is used to deliver probabilistic predictions that an outside observer—an econometrician—can form under arbitrary equilibrium selections. The sharpness of these predictions improves as the noise gets smaller, but disappears in the complete-information version of the model
Strategic directions in constraint programming
An abstract is not available
Twenty years of coordination technologies: State-of-the-art and perspectives
Since complexity of inter- and intra-systems interactions is steadily increasing in modern application scenarios (e.g., the IoT), coordination technologies are required to take a crucial step towards maturity. In this paper we look back at the history of the COORDINATION conference in order to shed light on the current status of the coordination technologies there proposed throughout the years, in an attempt to understand success stories, limitations, and possibly reveal the gap between actual technologies, theoretical models, and novel application needs
- …